package com.tengfei.api;

import com.baomidou.mybatisplus.core.toolkit.Sequence;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author feige
 * @version v1.0
 * @date 2022-10-16-21:29
 * @description 雪花生成算法
 */
public class AssignId {

    public static void main(String[] args) throws UnknownHostException {
        Sequence sequence = new Sequence(InetAddress.getLocalHost());
        for (int i = 0; i < 6; i++) {
            long l = sequence.nextId();
            System.out.println(i + "-->：" + l);
        }

    }

}
